package com.book.bookshop.entity.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

/**
 * @Since:jdk1.8 图书枚举类,来自mybatisplus 3的语法
 */
@Getter
public enum  Category {
    SELECTED(1,"精选图书"),RECOMMEND(2,"推荐图书"),BARGAIN(3,"特价图书");
    Category(int code,String desc){
        this.code =code;
        this.desc =desc;
    }

    @EnumValue//标记数据库的值是code
    private final int code;
    private final String desc;
}
